Field of the Invention
The present disclosure relates to a technique of verifying the performance of a program, and more specifically to a technique of verifying the performance of a program executed on a multi-core processor.
Description of the Background Art
An MBD (model-based design) tool utilized for vehicle control, signal processing and the like can use hierarchies from a high-order design hierarchy to a low-order ECU (electronic control unit) implementation hierarchy, in which MIL (Model-in-the-Loop) simulation and SIL (Software-in-the-Loop) simulation are successively used from the higher order position for testing of a control algorithm. Further, testing of codes mass-produced by a microcomputer includes an environment called PIL (Processor-in-the-Loop) simulation. In the PIL simulation environment where the MBD tool is used, the function of a program code generated for a single-core processor is verified. For example, Patent Document 1 (Japanese Patent Laying-Open No. 2003-173256) and Patent Document 2 (Japanese Patent Laying-Open No. 2011-154521) each disclose a method of generating a program code using a model-based development process and a system for making a performance evaluation.
In the PIL simulation environment, simulation can be performed by cooperation between a Simulink model mathematically representing the behavior of a controlled object or a controller, and a microcomputer or a microcomputer simulator. Examples of products of the PIL simulation environment include “ECPILS” of Renesas Electronics Corporation, which is an embedded tool chain for cooperative simulation with a Simulink model, and “SOFTUNE” of Spansion Innovates.
In ECPILS, a microcomputer evaluation board via an emulator communicates with a MATLAB/Simulink model simulation environment running on a PC (personal computer) and provided by The Mathworks, Inc, to implement PIL simulation. Instead of the microcomputer evaluation board, a microcomputer simulator running on a PC can communicate with the aforementioned model simulation environment to implement cooperative simulation.
That is, in the PIL simulation environment, C source code automatically generated from a model of a controller is executed by a microcomputer or a microcomputer simulator, so that it can be verified by simulation whether or not the behavior of a model of a controlled object called the plant can be controlled as intended by the designer.
In vehicle control and the like, the amount of computation has significantly increased in recent years due to sophistication of control such as stricter energy-saving fuel economy standards and tighter emission control standards. Thus, high computing process capability is expected even in a high-temperature operation environment such as an engine room. However, there is little room for improvement in microcomputer operating frequency in a high-temperature environment. Since a microcomputer is mounted on a vehicle, it is desirable for the microcomputer to consume less power because it reduces power supply, and reducing the number of components of the microcomputer can suppress an increase in vehicle weight, thereby also contributing to improved fuel efficiency. Thus, there exists a need for a development environment for control processing using a multi-core microcomputer having a feasible operating frequency and having a plurality of low-power-consumption CPU (central processing unit) cores mounted thereon.
In feedback control or closed loop control, which is one of the basic control schemes, a value from a sensor and a target value are input to a controller, and a control value is output to an actuator to control the object.
The closed loop control is widely used in vehicle control as well. Particularly, in a system designed based on a very short control cycle of between several tens of microseconds and several milliseconds for engine control, for example, the program of a controller needs to be created such that the controller can determine the amount of operation and output the determined amount of operation to the actuator without exceeding the control cycle time that has been set to satisfy various standards. Therefore, if vehicle control is to be implemented by a multi-core microcomputer, it is required to obtain the exact execution time including phenomena specific to multiple cores, such as communication overhead between the cores, and delay due to a conflict on a data bus.
The conventional techniques disclosed in Patent Documents 1 to 2 are model-based development techniques where a single-core processor is used. By contrast, in a conventional technique disclosed in Patent Document 3 (Japanese Patent Laying-Open No. 2014-102734), each of a plurality of tasks constituting the program of a controller is executed with a single core to calculate the execution time, to estimate a time of allocation of each task to any one of multiple cores and a processing time in the allocation.
That is, all of the conventional techniques merely implement simulation by cooperation with a single-core microcomputer, and none provides PIL simulation to parallel programs operated with multiple cores. This is partly because a complicated control procedure is required for simulation by cooperation between N programs executed by a multi-core microcomputer formed of N cores and a model simulator such as Simulink running on a PC, and such a control procedure has been considered to be incompatible with the simulation speed desired at the time of design.
Thus, in the PIL simulation environment of the single-core microcomputer in the conventional techniques, it has been impossible to divide a code generated by a controller designed as a model into a plurality of CPU cores, evaluate a manner of the division by also taking into account the effect of communication overhead due to the division and the like, and plan the allocation of tasks constituting a controller program to the cores.
If a development environment for planning the allocation to cores is implemented, a transient state or the like that cannot be computed by a microcomputer within a predetermined cycle can be detected in a vehicle control system which is designed with a very short control cycle as described above and which is required to have an extremely high degree of real-timeness. Accordingly, there is a need for a technique for considering and determining, based on a result of the detection, control of an actuator by a control value during a previous cycle, and improvement in control speed by providing the computing process function as hardware, in a step prior to system design.